<?php
 

namespace app\user\admin;

use app\admin\controller\Admin;
use app\common\builder\ZBuilder;
use think\Db;

class User extends Admin
{

    public function index(){
        $data   =   Db::table('users')->order('id desc')->paginate();
        return ZBuilder::make('table')
        ->hideCheckbox()
        ->setSearch(['tel','name'])
        ->addColumns([
            ['id','ID'],
            ['tel','手机号','callback',function($val){ return hideMiddle($val);}],
            ['name','姓名'],
            ['balance','余额'],
            ['province','省份'],
            ['city','城市'],
            
            ['agency_name','代理姓名'],
            ['agency_id','代理ID'], 
            ['agency_level','代理等级'],
            ['status','状态',[1=>'未认证',2=>'已认证',3=>'已绑卡']],
        ])
        ->setRowList($data)
        ->setPages($data->render())
        ->fetch();
    }
    
}
